{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Alessandro Parisi \n",
      "last updated: 2019-04-17 \n",
      "\n",
      "CPython 3.5.4\n",
      "IPython 6.1.0\n",
      "\n",
      "numpy 1.15.2\n",
      "pandas 0.23.4\n",
      "matplotlib 2.2.2\n",
      "sklearn 0.20.0\n",
      "seaborn 0.8.0\n"
     ]
    }
   ],
   "source": [
    "%load_ext watermark\n",
    "%watermark -a \"Alessandro Parisi\" -u -d -v -p numpy,pandas,matplotlib,sklearn,seaborn\n",
    "# to install watermark launch 'pip install watermark' at command line\n",
    "import warnings \n",
    "warnings.simplefilter('ignore')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[7.30333333 7.69166667 7.19166667]\n",
      " [7.69166667 8.12333333 7.54333333]\n",
      " [7.19166667 7.54333333 7.12333333]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "\n",
    "X = np.array([\n",
    " [3, 0.1, -2.4],\n",
    " [3.1, 0.3, -2.6],\n",
    " [3.4, 0.2, -1.9],\n",
    "])\n",
    "\n",
    "print(np.cov(X).T)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Eigenvaules: [-1.99999996 -2.00000004]\n",
      "Eigenvectors: [[0.70710678 0.70710678]\n",
      " [0.70710678 0.70710678]]\n"
     ]
    }
   ],
   "source": [
    "\"\"\"\n",
    "     __        __    \n",
    "    |            |   \n",
    "    | 2       -4 |  \n",
    "A = |            |  \n",
    "    | 4       -6 |  \n",
    "    |__        __| \n",
    "    \n",
    "\n",
    "\"\"\"\n",
    "\n",
    "\n",
    "import numpy as np\n",
    "eigenvaules, eigenvectors = np.linalg.eig(np.array([[2, -4], [4, -6]]))\n",
    "\n",
    "print(\"Eigenvaules:\", eigenvaules)\n",
    "print(\"Eigenvectors:\", eigenvectors)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Py35",
   "language": "python",
   "name": "py35"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
